package com.power.sifa.correction.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  再办任务实体类
*/

@Entity
@ApiModel(value="再办任务")
@Data
@Table(name="Cre_work_repeat",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Cre_work_repeat.Cre_work_repeatPK.class) 用于复合组件
public class Cre_work_repeat extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "预警id")
    private String warnid;

    @ApiModelProperty(value = "原始任务id")
    private String workid;

    @ApiModelProperty(value = "再办下达人id")
    private String createuserid;

    @ApiModelProperty(value = "再办下达人姓名")
    private String createusername;

    @ApiModelProperty(value = "再办意见")
    private String remark;

    @ApiModelProperty(value = "下达时间", example="2020-10-22 10:03:22")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createtime;

    /**
     * 预警处置任务
     */
    @Transient
    private Cre_work work;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("warnid", this.getWarnid());
        map.put("workid", this.getWorkid());
        map.put("createuserid", this.getCreateuserid());
        map.put("createusername", this.getCreateusername());
        map.put("remark", this.getRemark());
        map.put("createtime", this.getCreatetime());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Cre_work_repeatPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Cre_work_repeatPK pk = (Cre_work_repeatPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
